# exportui.py

from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(600, 500)
        
        self.main_layout = QtWidgets.QVBoxLayout(Dialog)
        self.main_layout.setContentsMargins(20, 20, 20, 20)
        self.main_layout.setSpacing(20)

        # 卡片1: 导出选项
        self.options_card = QtWidgets.QWidget(Dialog)
        self.options_card.setObjectName("InfoCard")
        self.options_layout = QtWidgets.QFormLayout(self.options_card)
        self.options_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
        self.options_layout.setHorizontalSpacing(20)
        self.options_layout.setVerticalSpacing(15)

        self.comboBox_time = QtWidgets.QComboBox(self.options_card)
        self.options_layout.addRow("时间范围:", self.comboBox_time)

        self.comboBox_type = QtWidgets.QComboBox(self.options_card)
        self.options_layout.addRow("消息类型:", self.comboBox_type)
        
        self.btn_select_all = QtWidgets.QPushButton("全选/取消全选", self.options_card)
        self.options_layout.addRow("", self.btn_select_all)
        self.main_layout.addWidget(self.options_card)

        # 卡片2: 导出进度和日志
        self.progress_card = QtWidgets.QWidget(Dialog)
        self.progress_card.setObjectName("InfoCard")
        self.progress_layout = QtWidgets.QVBoxLayout(self.progress_card)

        self.textBrowser = QtWidgets.QTextBrowser(self.progress_card)
        self.progress_layout.addWidget(self.textBrowser)

        self.progressBar = QtWidgets.QProgressBar(self.progress_card)
        self.progressBar.setProperty("value", 0)
        self.progress_layout.addWidget(self.progressBar)
        self.main_layout.addWidget(self.progress_card, 1) # 占据伸缩空间

        # 底部操作按钮
        self.bottom_layout = QtWidgets.QHBoxLayout()
        self.bottom_layout.addStretch()
        self.btn_cancel = QtWidgets.QPushButton(Dialog)
        self.bottom_layout.addWidget(self.btn_cancel)
        self.btn_start = QtWidgets.QPushButton(Dialog)
        self.btn_start.setObjectName("PrimaryButton")
        self.bottom_layout.addWidget(self.btn_start)
        self.main_layout.addLayout(self.bottom_layout)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        _translate = QtCore.QCoreApplication.translate
        Dialog.setWindowTitle(_translate("Dialog", "导出聊天记录"))
        self.comboBox_time.addItem(_translate("Dialog", "全部时间"))
        self.comboBox_time.addItem(_translate("Dialog", "最近三个月"))
        self.comboBox_time.addItem(_translate("Dialog", "自定义时间"))
        self.comboBox_type.addItem(_translate("Dialog", "全部聊天记录(含媒体文件)"))
        self.comboBox_type.addItem(_translate("Dialog", "仅文本内容"))
        self.btn_start.setText(_translate("Dialog", "开始导出"))
        self.btn_cancel.setText(_translate("Dialog", "取消"))